;Make all position reference become relative
AutoItSetOption("MouseCoordMode", 0)

If WinExists("[23-st733] eFin Smart Portal ") Then
   WinClose("[23-st733] eFin Smart Portal ")
   Sleep(5000)
EndIf

ShellExecuteWait("C:\Documents and Settings\Admin\Start Menu\Programs\Online Asset\Smart Portal.appref-ms")
Sleep(20000)

If WinExists(" Welcome To eFin Smart Portal") Then
   
   ConsoleWrite("Get to the logon" & @CRLF)
   
   MouseClick("", 233, 84, 2, 500)
   Send("s")
   
   MouseClick("", 147, 108)
   Send("23-st733")
   
   MouseClick("", 155, 134)
   Send("57801")
   
   MouseClick("", 282, 108)
   
   Sleep(20000)
   
EndIf

WinActivate("[23-st733] eFin Smart Portal ")

;Click the Graph title bar
MouseClick("", 1120, 104, 2)
Sleep(2000)

;Click to show Graph toolbar
MouseClick("", 375, 29)
Sleep(2000)

;Make sure that it's SET50
Send("{SPACE}")
Sleep(125)
Send("SET50")
Sleep(125)
Send("{ENTER}")

Sleep(5000)

;Click to set FROM-DATE
MouseClick("", 640, 105)
Send("01{RIGHT}")
Sleep(125)
Send("03{RIGHT}")
Sleep(125)
Send("2013")
Sleep(250)
MouseClick("", 820, 104)

Sleep(5000)

Send("!{PRINTSCREEN}")

FileDelete("c:\inetpub\wwwroot\set50.png")

ShellExecute("C:\WINDOWS\system32\mspaint.exe")
WinWaitActive("untitled - Paint")
Send("^v")
Sleep(250)
Send("^s")
Sleep(250)
Send("c:\inetpub\wwwroot\set50.png")
Sleep(250)
MouseClick("", 436, 388, 2, 1000)
Send("p")
Send("{ENTER}")
Sleep(1000)
WinClose("")

